﻿using System;
using System.Web.Mvc;
using HQPad.Models;

namespace HQPad.Controllers
{
    public class BaseController : Controller
    {
        protected void BuildPageTitle(string pagePart)
        {
            ViewBag.Title = string.Format("Heroquest Character Pad - {0}", pagePart);
        }

        protected void PopulateRuleVersion(Skill skill)
        {
            ViewBag.RulesVersion = string.Format("{0}.{1}", skill.Rules.MajorVersion, skill.Rules.MinorVersion);
            ViewBag.RuleSetID = skill.RuleSetID;
        }

        protected void PopulateRuleVersion(RuleSet rules)
        {
            ViewBag.RulesVersion = string.Format("{0}.{1}", rules.MajorVersion, rules.MinorVersion);
            ViewBag.RuleSetID = rules.RuleSetID;
        }

    }
}